home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-17 | 22.4 KB | 626 lines | [TEXT/ALFA] |
- #================================================================================
- #
- # html.tcl, HTML mode 1.4.1: macros and bindings for editing HTML documents.
- #
- #================================================================================
- #
- # version 0.24 (16 July 95) by Scott W. Brim <swb1@cornell.edu>
- # version 1.0 -- 1.4.1 (April 97) by Johan Linde <jl@theophys.kth.se>
- #
- # Copyright 1996, 1997 by Johan Linde.
- # This software may be used freely, and distributed freely, as long as
- # the receiver is not obligated in any way by receiving it.
- #
- # Original ideas taken from Marc Andreesen's html.el and Tom Scavo's latex.tcl.
- #
- # If you make improvements to this file, please share them!
- #
- # Johan Linde <jl@theophys.kth.se>
- #
- #================================================================================
-
- # called by Alpha to load HTML in.
- proc htmlDummy {} {}
- proc htmlMenu {} {}
-
- #===============================================================================
- # Global variables and their management
- #===============================================================================
-
- if {![info exists htmlMenu]} {set htmlMenu "•135"}
-
-
- # Home pages, set the old one if it exists.
- if {[info exists homePagePath] && [string length $homePagePath] &&
- [info exists HTMLmodeVars(baseURL)] && [string length $HTMLmodeVars(baseURL)]} {
- if {![info exists HTMLmodeVars(basePath)]} {set HTMLmodeVars(basePath) ""}
- newModeVar HTML homePages [list [list [string trimright $homePagePath :] $HTMLmodeVars(baseURL) $HTMLmodeVars(basePath) "index.html"]] 0
- lappend modifiedModeVars {homePages HTMLmodeVars}
- } else {
- newModeVar HTML homePages {} 0
- }
-
-
- # Unsetting old flags and variables which may be defined in arrdefs.tcl
- catch {unset HTMLmodeVars(dlEntries)}
- catch {unset HTMLmodeVars(useCtlCmd)}
- catch {unset HTMLmodeVars(allContainers)}
- catch {unset HTMLmodeVars(quotedAttrs)}
- catch {unset HTMLmodeVars(htmlBindPrefix)}
- catch {unset HTMLmodeVars(htmlSBindPrefix)}
- catch {unset HTMLmodeVars(htmlMenuPrefix)}
- catch {unset HTMLmodeVars(htmlSMenuPrefix)}
- catch {unset HTMLmodeVars(URLAttrs)}
- catch {unset HTMLmodeVars(ColorAttrs)}
- catch {unset HTMLmodeVars(elemAttrsForAll)}
- catch {unset HTMLmodeVars(useStatusBar)}
- catch {unset HTMLmodeVars(baseURL)}
- catch {unset HTMLmodeVars(basePath)}
-
- # Line width
- newModeVar HTML fillColumn 75 0
- newModeVar HTML leftFillColumn 0 0
- # word breaking and word wrapping
- newModeVar HTML wordBreak {\w+} 0
- newModeVar HTML wordBreakPreface {(\W)} 0
- newModeVar HTML wrapBreak {[\w_]+} 0
- newModeVar HTML wrapBreakPreface {([^\w_])} 0
-
- # browsers
- if {![info exists browserSig]} {set browserSig MOSS}
- newModeVar HTML browsers {MOSS MSIE} 0
-
- newModeVar HTML wordWrap 1 1
- newModeVar HTML prefixString "<!-- " 0
- newModeVar HTML suffixString " -->" 0
-
- # Paths to footer files.
- newModeVar HTML footers {} 0
- # Tag color
- newModeVar HTML tagColor blue 0
- # Should elements be lower case?
- newModeVar HTML useLowerCase 0 1
- # Should •'s be inserted?
- newModeVar HTML useTabMarks 1 1
- # Is <p> a container?
- newModeVar HTML pIsContainer 1 1
- # Are LI DT and DD containers
- newModeVar HTML lidtAreContainers 0 1
- # A list of URLs, cached, to pick from for insertion
- newModeVar HTML URLs {} 0
- # A window cache with frames.
- newModeVar HTML windows {} 0
- # When browser is launched, should it be brought to front?
- newModeVar HTML browseInForeground 1 1
- # Save without asking when sending file to browser?
- newModeVar HTML saveWithoutAsking 0 1
- # list of commonly used character entities
- newModeVar HTML defaultCommonChars {"less than" "greater than" "ampersand"} 0
- newModeVar HTML commonChars $HTMLmodeVars(defaultCommonChars) 0
- # Which HTML package?
- newModeVar HTML htmlPackageToUse 1 0
- # Include event handlers in attribute dialog?
- newModeVar HTML inclEventHandler 0 1
- # Beep when asking for attributes in the status bar?
- newModeVar HTML promptNoisily 1 1
- # Input from big windows?
- newModeVar HTML useBigWindows 1 1
- # Check anchors in links
- newModeVar HTML checkAnchors 1 1
- # Case sensistive link checking?
- newModeVar HTML caseSensitive 0 1
- # Check links with Big Brother?
- newModeVar HTML useBigBrother 0 1
- newModeVar HTML checkInFront 1 1
- newModeVar HTML useBBoptions 1 1
- newModeVar HTML ignoreRemote 0 1
- newModeVar HTML ignoreLocal 0 1
- # Folder for HTML manual.
- newModeVar HTML manualFolder {} 0
-
- # JavaScript stuff
- newModeVar HTML JavaScriptColoring 0 1
- newModeVar HTML JavaScriptColor magenta 0
- newModeVar HTML stringColor green 0
- newModeVar HTML JavaCommentColor red 0
- newModeVar HTML elecRBrace 0 1
- newModeVar HTML elecLBrace 0 1
-
- # These mode variables should not appear in the config dialog.
-
- set HTMLinvisibleModeVars(htmlPackageToUse) 1
- set HTMLinvisibleModeVars(footers) 1
- set HTMLinvisibleModeVars(windows) 1
- set HTMLinvisibleModeVars(URLs) 1
- set HTMLinvisibleModeVars(defaultCommonChars) 1
- set HTMLinvisibleModeVars(commonChars) 1
- set HTMLinvisibleModeVars(browserSig) 1
- set HTMLinvisibleModeVars(homePages) 1
- set HTMLinvisibleModeVars(useBigBrother) 1
- set HTMLinvisibleModeVars(browsers) 1
- set HTMLinvisibleModeVars(manualFolder) 1
-
- # These attributes are URLs.
- set htmlURLAttr {HREF= SRC= LOWSRC= ACTION= USEMAP= BACKGROUND= CODEBASE= PLUGINSPAGE=}
- # These element attributes are colors
- set htmlColorAttr {BGCOLOR= TEXT= LINK= VLINK= ALINK= COLOR= BORDERCOLOR=}
- # These attributes are windows
- set htmlWindowAttr {TARGET=}
- # Special cases with URLs, colors and windows
- set htmlSpecURL {}
- set htmlSpecColor {}
- set htmlSpecWindow {}
- # These elements can be in document HEAD.
- set htmlHeadElements1 {BASE ISINDEX LINK META SCRIPT}
- set htmlHeadElements3 {BASE ISINDEX LINK META}
- # These elements are plug-ins.
- set htmlPlugins {EMBED LIVEAUDIO LIVEVIDEO "QUICKTIME MOVIE" "QUICKTIME VR" REALAUDIO}
- # HTML mode version
- set htmlVersion 1.41
-
- # Used by fillParagraph
- set htmlParaCommands {html|head|title|body|h[1-6]|p|div|blockquote|center|address|pre|multicol}
- append htmlParaCommands {|br|hr|wbr|basefont|ul|ol|li|dir|menu|dl|dd|dt|form|input}
- append htmlParaCommands {|select|option|textarea|caption|table|tr|frameset|frame|noframes}
- append htmlParaCommands {|map|area|applet|param|script|noscript|base|link|meta|isindex}
-
- #
- # Internal Globals
- #
- set htmlCurSel ""
- set htmlIsSel 0
- set htmlExtIsLoaded 0
- set html32IsLoaded 0
- set htmlAdditionExist 0
-
- set htmlIsLoaded 1
- if { [catch {source "$HOME:Tcl:Modes:htmlEngine.tcl"}] } {
- set htmlIsLoaded 0
- beep
- alertnote "Loading of htmlEngine.tcl failed"
- }
-
-
- if { [catch {source "$HOME:Tcl:Modes:htmlElems.tcl"}] } {
- set htmlIsLoaded 0
- beep
- alertnote "Loading of htmlElems.tcl failed"
- }
-
- if { [catch {source "$HOME:Tcl:Modes:htmlUtils.tcl"}] } {
- set htmlIsLoaded 0
- beep
- alertnote "Loading of htmlUtils.tcl failed"
- }
-
- if { [catch {source "$HOME:Tcl:Modes:htmlMenu.tcl"}] } {
- set htmlIsLoaded 0
- beep
- alertnote "Loading of htmlMenu.tcl failed"
- }
-
- if {!$HTMLmodeVars(useBigWindows) && [catch {source "$HOME:Tcl:Modes:htmlExtra.tcl"}] } {
- set htmlIsLoaded 0
- beep
- alertnote "Loading of htmlExtra.tcl failed"
- }
-
- #
- # Read custom elements
- #
-
- proc htmlReadAdditions {} {
- global PREFS htmlElemAttrRequired1 htmlElemAttrOptional1 htmlElemAttrChoices1
- global htmlElemAttrNumber1 htmlElemEventHandler1 htmlElemKeyBinding htmlElemProc
- global htmlExtIsLoaded htmlURLAttr htmlColorAttr htmlWindowAttr htmlPlugins
- global htmlSpecURL htmlSpecColor htmlSpecWindow htmlVersion htmlShownWarning
-
- message "Loading custom elements…"
-
- htmlExtensions
- set htmlExtIsLoaded 1
- rename htmlExtensions ""
-
- if {[catch {open $PREFS:HTMLadditions.tcl r} fid]} {
- alertnote "Could not open the file HTMLAdditions.tcl with your custom elements."
- return
- }
- set additions [read -nonewline $fid]
- close $fid
- set lines [split $additions "\n"]
- set version [lindex $lines 0]
- if {$version == $htmlVersion} {htmlReadAdditions0 $lines; return}
- if {$version > $htmlVersion} {
- regsub "\[^\n\]+" $additions $htmlVersion additions
- set fid [open $PREFS:HTMLadditions.tcl w]
- puts $fid $additions
- close $fid
- htmlReadAdditions0 $lines
- return
- }
- set allattrs [htmlGetAllAttrs]
- set newLines "$htmlVersion\n"
- set changed 0
- set tmpSpecURL ""
- set tmpSpecColor ""
- set tmpSpecWindow ""
- foreach line [lrange $lines 1 end] {
- set elem [lindex $line 0]
- set command [lindex $line 1]
- set elemExists [info exists htmlElemAttrOptional1($elem)]
- if {$elemExists} {
- foreach x [list AttrOptional1 AttrRequired1 AttrNumber1 AttrChoices1 EventHandler1] {
- if {[info exists htmlElem${x}($elem)]} {
- set $x [string toupper [set htmlElem${x}($elem)]]
- } else {
- set $x ""
- }
- }
- set attrs [concat $AttrOptional1 $AttrRequired1 $EventHandler1]
- foreach at $attrs {
- if {[string trimright $at =] == $at} {
- lappend attrs "${at}="
- } else {
- lappend attrs [string trimright $at =]
- }
- }
- } else {
- set attrs {}
- }
- set var [lindex $command 1]
- foreach ucw [list URL Color Window] {
- if {$var == "html${ucw}Attr"} {
- set att [lindex $command 2]
- if {[lsearch -exact [set html${ucw}Attr] $att] >=0} {
- # Already defined.
- set changed 1
- } elseif {[lsearch -exact $allattrs $att] >=0 || [lsearch -exact $allattrs [string trimright $att =]] >=0} {
- # Used for some other kind of attr.
- lappend ${ucw}SpecMaybe $att
- set changed 1
- } elseif {[lsearch -exact $attrs $att] >= 0} {
- # Attr already exists for elem.
- lappend ${ucw}Maybe $att
- set changed 1
- } else {
- append newLines "$line\n"
- }
- }
- if {$var == "htmlSpec${ucw}"} {
- set tmpadd [lrange $command 2 end]
- foreach x $tmpadd {
- regexp {[^!=]!?=(.*)} $x dum tmp
- # Only add if attr doesn't exist.
- if {[lsearch -exact $attrs $tmp] >= 0} {
- set changed 1
- set where [lsearch -exact $tmpadd $x]
- set tmpadd [lreplace $tmpadd $where $where]
- }
- }
- if {[llength $tmpadd]} {
- append newLines "[list $elem] \{lappend htmlSpec${ucw} $tmpadd\}\n"
- append tmpSpec${ucw} " " $tmpadd
- }
- }
- }
- if {[lsearch {htmlURLAttr htmlColorAttr htmlWindowAttr htmlSpecURL \
- htmlSpecColor htmlSpecWindow} $var] < 0} {
- # If element doesn't exist, GO!
- if {!$elemExists} {
- append newLines "$line\n"
- regsub "html" $command "tmp" command
- eval $command
- continue
- }
- # Skip these vars if element exists.
- if {[string match "htmlElemKeyBinding*" $var] || [string match "htmlElemProc*" $var] ||
- $var == "htmlPlugins"} {
- set changed 1
- continue
- }
- regexp {([^\(]+)\(([^\)]+)\)[ ]+(.+)} [lrange $command 1 end] dummy var arg added
- set added [string trimleft [string trimright $added \}] \{]
- foreach c $added {
- if {$var == "htmlElemAttrChoices1"} {
- regexp {[^=]*=} $c tmp
- # Don't add choices if they exist or if attr isn't a choice attr.
- if {[lsearch -exact $AttrChoices1 $c] >= 0 || ([lsearch -exact $attrs $tmp] >= 0 &&
- [lsearch $AttrChoices1 "${tmp}*"] < 0) } {
- set changed 1
- set where [lsearch -exact $added $c]
- set added [lreplace $added $where $where]
- }
- } else {
- if {$var == "htmlElemAttrNumber1"} {
- regexp {[^=]*=} $c tmp
- } else {
- set tmp [string toupper $c]
- }
- # Don't add attrs which exist.
- if {[lsearch -exact $attrs $tmp] >= 0} {
- set changed 1
- set where [lsearch -exact $added $c]
- set added [lreplace $added $where $where]
- }
- }
- }
- if {[llength $added]} {
- append newLines "[list $elem] \{lappend ${var}($arg) $added\}\n"
- regsub "html" $var "tmp" var
- eval "lappend ${var}($arg) $added"
- }
- }
- }
- foreach ucw [list URL Color Window] {
- if {[info exists ${ucw}SpecMaybe]} {
- foreach m [set ${ucw}SpecMaybe] {
- foreach e [array names tmpElemAttrRequired1] {
- if {[lsearch -exact $tmpElemAttrRequired1($e) $m] >= 0 && \
- [lsearch -exact [set tmpSpec$ucw] "$e!=[string trimright $m =]"] < 0} {
- append newLines "[list $e] \{lappend htmlSpec${ucw} ${e}=[string trimright $m =]\}\n"
- }
- }
- foreach e [array names tmpElemAttrOptional1] {
- if {[lsearch -exact $tmpElemAttrOptional1($e) $m] >= 0 && \
- [lsearch -exact [set tmpSpec$ucw] "$e!=[string trimright $m =]"] < 0} {
- append newLines "[list $e] \{lappend htmlSpec${ucw} ${e}=[string trimright $m =]\}\n"
- }
- }
- }
- }
- if {[info exists ${ucw}Maybe]} {
- foreach m [set ${ucw}Maybe] {
- set foundit 0
- foreach e [array names tmpElemAttrRequired1] {
- if {[lsearch -exact $tmpElemAttrRequired1($e) $m] >= 0 && \
- [lsearch -exact [set tmpSpec$ucw] "$e!=[string trimright $m =]"] < 0} {
- append newLines "[list $e] \{lappend html${ucw}Attr $m\}\n"
- set foundit 1
- break
- }
- }
- if {$foundit} {continue}
- foreach e [array names tmpElemAttrOptional1] {
- if {[lsearch -exact $tmpElemAttrOptional1($e) $m] >= 0 && \
- [lsearch -exact [set tmpSpec$ucw] "$e!=[string trimright $m =]"] < 0} {
- append newLines "[list $e] \{lappend html${ucw}Attr $m\}\n"
- break
- }
- }
- }
- }
- }
-
- if {$newLines != "$htmlVersion\n"} {htmlReadAdditions0 [split [string trimright $newLines "\n"] "\n"]}
- if {$changed} {
- beep
- if {[lindex [dialog -w 300 -h 270 -b "Clean up" 20 240 100 260 \
- -b "Leave it" 120 240 200 260 -t "Some of your custom elements are supported by this\
- version of HTML mode." 10 10 290 45 -t "Choose 'Clean up' to update your file with custom\
- elements and to avoid this alert next time you run Alpha.\
- If you do so, some elements will not be defined correctly if you go back to\
- a previous version of HTML mode." 10 50 290 150 -t "Choose 'Leave it' to leave your file\
- with custom elements untouched. If you do so, the submenu 'Extend', where you can add new custom\
- elements, will be disabled." 10 160 290 225] 1]} {
- set htmlShownWarning 1
- return
- }
- }
- if {$newLines == "$htmlVersion\n"} {
- removeFile $PREFS:HTMLadditions.tcl
- } else {
- set fid [open $PREFS:HTMLadditions.tcl w]
- puts -nonewline $fid $newLines
- close $fid
- }
- }
-
- proc htmlReadAdditions0 {lines} {
- global PREFS htmlElemAttrRequired1 htmlElemAttrOptional1 htmlElemAttrChoices1
- global htmlElemAttrNumber1 htmlElemEventHandler1 htmlElemKeyBinding htmlElemProc
- global htmlExtIsLoaded htmlURLAttr htmlColorAttr htmlWindowAttr htmlPlugins
- global htmlSpecURL htmlSpecColor htmlSpecWindow htmlAdditionExist htmlShownWarning
-
- foreach line [lrange $lines 1 end] {
- if {[catch {eval [lindex $line 1]}]} {
- alertnote "There is an error in the file HTMLAdditions.tcl with your custom elements."
- set htmlShownWarning 1
- break
- }
- }
- set htmlAdditionExist 1
- }
-
- #
- # Color support
- #
-
- proc htmlColorizing {} {
- global HTMLmodeVars HTMLwords htmlElemAttrOptional1 htmlElemAttrRequired1
- global htmlExtIsLoaded htmlElemEventHandler1
-
- set HTMLKeyWords {}
- if {[info exists HTMLwords]} {set HTMLKeyWords [concat $HTMLKeyWords $HTMLwords]}
-
- if {$HTMLmodeVars(JavaScriptColoring)} {
- if {!$htmlExtIsLoaded} {
- htmlExtensions
- set htmlExtIsLoaded 1
- rename htmlExtensions ""
- }
- set allHTMLwords [array names htmlElemAttrOptional1]
- foreach elem $allHTMLwords {
- lappend allHTMLkeywords "<${elem}" "/${elem}"
- if {[info exists htmlElemAttrRequired1($elem)]} {
- foreach attr $htmlElemAttrRequired1($elem) {
- if {[lsearch -exact $allHTMLkeywords $attr] < 0} {
- lappend allHTMLkeywords $attr
- }
- }
- }
- foreach attr $htmlElemAttrOptional1($elem) {
- if {[lsearch -exact $allHTMLkeywords $attr] < 0} {
- lappend allHTMLkeywords $attr
- }
- }
- }
-
- lappend allHTMLkeywords "<INPUT" "<!--" "-->" "FILE=" "FORM=" "#INCLUDE" "/#INCLUDE" "#LASTMODIFIED" "/#LASTMODIFIED"
- set JavaScriptWords {break continue for in function if else new return this var while with true false }
- foreach elem [array names htmlElemEventHandler1] {
- foreach event $htmlElemEventHandler1($elem) {
- if {[lsearch -exact $JavaScriptWords $event] < 0} {
- lappend JavaScriptWords $event
- }
- }
- }
- regModeKeywords -i "<" -i ">" -I $HTMLmodeVars(tagColor) -e "//" -b "/*" "*/" \
- -c $HTMLmodeVars(JavaCommentColor) \
- -s $HTMLmodeVars(stringColor) -k $HTMLmodeVars(JavaScriptColor) \
- HTML $JavaScriptWords
- regModeKeywords -a -k $HTMLmodeVars(tagColor) \
- HTML [concat $HTMLKeyWords $allHTMLkeywords]
- } else {
- regModeKeywords -b "<" ">" -c $HTMLmodeVars(tagColor) \
- -k $HTMLmodeVars(tagColor) HTML $HTMLKeyWords
- }
- }
-
- # Change color when a color variable is changed.
- proc htmlChangeColorizing {name1 name2 op} {
- global HTMLmodeVars
- if {$name2 == "JavaScriptColoring" } {
- htmlColorizing
- message "Coloring may not change until you switch to another window."
- } elseif {$name2 == "tagColor"} {
- if {!$HTMLmodeVars(JavaScriptColoring)} {
- regModeKeywords -a -c $HTMLmodeVars(tagColor) HTML
- } else {
- htmlColorizing
- message "Coloring may not change until you switch to another window."
- }
- } elseif {$name2 == "JavaScriptColor" && $HTMLmodeVars(JavaScriptColoring)} {
- htmlColorizing
- message "Coloring may not change until you switch to another window."
- } elseif {$name2 == "JavaCommentColor" && $HTMLmodeVars(JavaScriptColoring)} {
- regModeKeywords -a -c $HTMLmodeVars(JavaCommentColor) HTML
- }
- centerRedraw
- }
-
- proc htmlShadowAttrUse {name1 name2 op} {
- global HTMLmodeVars htmlMenu
- enableMenuItem $htmlMenu "Use Attributes" [expr !$HTMLmodeVars(useBigWindows)]
- }
-
- trace variable HTMLmodeVars(tagColor) w htmlChangeColorizing
- trace variable HTMLmodeVars(JavaScriptColor) w htmlChangeColorizing
- trace variable HTMLmodeVars(JavaScriptColoring) w htmlChangeColorizing
- trace variable HTMLmodeVars(JavaCommentColor) w htmlChangeColorizing
- trace variable HTMLmodeVars(useBigWindows) w htmlShadowAttrUse
- trace variable browserSig w htmlToggleBrowser2
-
- # Dialog to set HTML mode variables.
- proc HTMLmodifyFlags {} {
- global HTMLmodeVars modifiedModeVars colorInds tcl_var_procs
- set colors {none blue cyan green magenta red white yellow}
- foreach c [array names colorInds] {
- if {[regexp {color} $c]} {lappend colors $c}
- }
- set box "-t {HTML mode Settings} 150 10 300 30 \
- -m {General General JavaScript {Checking links} {Word Wrapping}} 150 40 300 60 \
- -n General \
- -c {Bring browser to front when sending a window to it} $HTMLmodeVars(browseInForeground) 10 70 450 85\
- -c {Save window without asking when sending it to the browser} $HTMLmodeVars(saveWithoutAsking) 10 90 450 105 \
- -c {Set tags in lower case} $HTMLmodeVars(useLowerCase) 10 110 450 125 \
- -c {Use tab marks (•)} $HTMLmodeVars(useTabMarks) 10 130 450 145 \
- -c {<P> has a closing tag </P>} $HTMLmodeVars(pIsContainer) 10 150 450 165 \
- -c {<LI>, <DT> and <DD> have closing tags} $HTMLmodeVars(lidtAreContainers) 10 170 450 185\
- -c {Give attributes in dialog windows, not in the status bar} $HTMLmodeVars(useBigWindows) 10 190 450 205 \
- -c {Beep for each attribute (applies only if you use the status bar)} $HTMLmodeVars(promptNoisily) 10 210 450 225 \
- -t {Color of HTML tags:} 10 240 150 260 \
- -m [list [concat $HTMLmodeVars(tagColor) $colors]] 160 240 310 260 \
- -n JavaScript \
- -c {Color JavaScript keywords} $HTMLmodeVars(JavaScriptColoring) 10 70 450 85\
- -c {Electric left braces} $HTMLmodeVars(elecLBrace) 10 90 450 105 \
- -c {Electric right braces} $HTMLmodeVars(elecRBrace) 10 110 450 125 \
- -c {Include event handlers in attribute dialog} $HTMLmodeVars(inclEventHandler) 10 130 450 145 \
- -t {The settings below apply only if you color JavaScript keywords} 10 160 450 175 \
- -t {Color of JavaScript keywords:} 10 190 210 205 \
- -m [list [concat $HTMLmodeVars(JavaScriptColor) $colors]] 220 190 360 210 \
- -t {Color of JavaScript comments:} 10 220 215 235 \
- -m [list [concat $HTMLmodeVars(JavaCommentColor) $colors]] 220 220 360 240 \
- -t {Color of strings:} 10 250 220 265 \
- -m [list [concat $HTMLmodeVars(stringColor) $colors]] 220 250 360 270 \
- -n {Checking links} \
- -t {These settings apply when you check links with Alpha} 10 70 450 85 \
- -c {Check anchors} $HTMLmodeVars(checkAnchors) 10 90 450 105 \
- -c {Case sensitive checking (slower)} $HTMLmodeVars(caseSensitive) 10 110 450 125 \
- -t {These settings apply when you check links with Big Brother} 10 135 450 150\
- -c {Bring Big Brother to front when checking links} $HTMLmodeVars(checkInFront) 10 155 450 170\
- -c {Use Big Brother's link check options} $HTMLmodeVars(useBBoptions) 10 175 450 190\
- -c {Ignore remote links (if you don't use Big Brother's option)} $HTMLmodeVars(ignoreRemote) 30 195 450 210\
- -c {Ignore local links (if you don't use Big Brother's option)} $HTMLmodeVars(ignoreLocal) 30 215 450 230\
- -n {Word Wrapping} \
- -t {Line width:} 10 70 90 85 -e [list $HTMLmodeVars(fillColumn)] 100 70 140 85 \
- -t characters 145 70 300 85 \
- -t {The variables below determine which characters build up words, and the word wrapping. Normally\
- there is no need to change them. Read about them in general manual if you want to change them.} \
- 10 100 450 160 \
- -t wordBreak: 10 170 150 185 -e [list $HTMLmodeVars(wordBreak)] 155 170 450 185 \
- -t wordBreakPreface: 10 195 150 210 -e [list $HTMLmodeVars(wordBreakPreface)] 155 195 450 210 \
- -t wrapBreak: 10 220 150 235 -e [list $HTMLmodeVars(wrapBreak)] 155 220 450 235 \
- -t wrapBreakPreface: 10 245 150 260 -e [list $HTMLmodeVars(wrapBreakPreface)] 155 245 450 260"
- set values [eval [concat dialog -w 460 -h 320 -b OK 20 290 85 310 -b Cancel 110 290 175 310 $box]]
- if {[lindex $values 1]} {return}
- set i 2
- foreach flag [list browseInForeground saveWithoutAsking useLowerCase useTabMarks pIsContainer lidtAreContainers \
- useBigWindows promptNoisily tagColor JavaScriptColoring elecLBrace \
- elecRBrace inclEventHandler JavaScriptColor JavaCommentColor stringColor \
- checkAnchors caseSensitive checkInFront useBBoptions ignoreRemote ignoreLocal \
- fillColumn wordBreak wordBreakPreface wrapBreak wrapBreakPreface] {
- global $flag
- incr i
- set val [lindex $values $i]
- if {$HTMLmodeVars($flag) != $val} {
- set $flag $val
- set HTMLmodeVars($flag) $val
- lappend modifiedModeVars [list $flag HTMLmodeVars]
-
- if {[info exists tcl_var_procs($flag)]} {
- $tcl_var_procs($flag) $flag
- }
- }
- }
- }
-
-
- if {$htmlIsLoaded} {
- if {[file exists $PREFS:HTMLadditions.tcl]} {
- if {[catch {htmlReadAdditions}]} {alertnote "An error occured while reading your custom elements."}
- }
- rename htmlReadAdditions ""
- rename htmlReadAdditions0 ""
- htmlBindKeys
- rename htmlBindKeys ""
- message "Building HTML menu…"
- htmlBuildMenu
- htmlColorizing
- # Check that all home page folders exist.
- set tmp_notfind ""
- foreach tmp_hp $HTMLmodeVars(homePages) {
- if {![file exists [lindex $tmp_hp 0]] || ![file isdirectory [lindex $tmp_hp 0]]} {
- alertnote "Can't find the folder for the home page [lindex $tmp_hp 1][lindex $tmp_hp 2]"
- set tmp_notfind "[lindex $tmp_hp 1][lindex $tmp_hp 2]"
- }
- }
- if {$tmp_notfind != ""} {htmlHomePages $tmp_notfind}
- message "HTML initialization complete."
- catch {unset tmp_notfind tmp_hp}
- } else {
- message "HTML initialization failed."
- }
-
- unset htmlIsLoaded
-
-